﻿
@{
    ViewBag.Title = "XXCheckRecord";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<link href="~/Content/Kalendae/kalendae.css" rel="stylesheet" />
<script src="~/Content/Kalendae/kalendae.standalone.js"></script>
<style>
    .kalendae .k-days span {
        /* 水平居中 */
        text-align: center;
        width: 12.8%;
        /* 高度 4.5em效果比较好 height等于line-height就能垂直居中了 */
        height: 4.5em;
        line-height: 4.5em;
        padding: 2px 3px 2px 2px;
        border: 1px solid transparent;
        border-radius: 3px;
        color: #999;
    }
</style>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">学校考勤</a></li>
    </ul>
</div>
<div class="formbody">
    <ul class="seachform">
        <li>
            <label>开始日期:</label>
            <input type="text" class="dfinput Wdate" id="StartDate" style="height:34px" placeholder="开始日期" onFocus="WdatePicker()" value="@DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")" />
        </li>
        <li>
            <label>结束日期:</label>
            <input type="text" class="dfinput Wdate" id="EndDate" style="height:34px" placeholder="结束日期" onFocus="WdatePicker()" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
        </li>

        <li>
            <label>&nbsp;</label>
            <input name="" id="ok" type="button" class="scbtn" value="查询" />
            <label>&nbsp;</label>
            @*<input name="" id="export" type="button" class="scbtn" value="导出" />*@


            <input name="" id="export" type="button" class="scbtn" value="导出EXCEL" onclick="fnExport()" />
        </li>
    </ul>
</div>
<div class="table-content">
    <table id="table" class="tablelist"></table>
</div>
<script type="text/javascript" charset="utf-8">

    $(function () {
        var $table = $('#table'), $ok = $('#ok');
        $ok.click(function () {
            $table.bootstrapTable('refresh');
        });

        function queryParams(params) {
            $('#toolbar').find('input[name]').each(function () {
                params[$(this).attr('name')] = $(this).val();
            });
            //params["UserName"] = $("#UserName").val();
            params["StartDate"] = $("#StartDate").val();
            params["EndDate"] = $("#EndDate").val();
            return params;
        }

        function responseHandler(res) {
            return res.rows;
        }
        $('#table').bootstrapTable({
            url: '/AccessRecord/GetXXCheckRecord',
            //url: '/api/Document/GetList',
            pagination: true,
            sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1,                       //初始化加载第一页，默认第一页
            pageSize: 10,                       //每页的记录行数（*）
            pageList: [10],        //可供选择的每页的行数（*）
            //search: true,   //是否显示表格搜索，此搜索是客户端搜索
            striped: true,
            queryParams: queryParams,
            //responseHandler:responseHandler,
            toolbar: "#toolbar",
            columns: [{
                field: 'Number',
                title: '序号',
                align: 'center',
                width: 50,
                
            }, {
                field: 'UserName',
                title: '姓名'
            },
            {
                field: 'BeLate',
                title: '迟到(次)'
            },
            {
                field: 'BeEarly',
                title: '早退(次)'
            },
            {
                field: 'BeNo',
                title: '未签(次)'
                },
                {
                    field: 'BeAway',
                    title: '旷工(天)'
                },
                {
                    field: 'Holiday',
                    title: '公假(天)'
                },
                 {
                     field: 'Leave',
                     title: '事假(天)'
                 },
                {
                    field: 'Sick',
                    title: '病假(天)'
                },
                {
                    field: 'Baby',
                    title: '产假(天)'
                },
                {
                    field: 'Marrid',
                    title: '婚假(天)'
                },
                {
                    field: 'Stray',
                    title: '丧假(天)'
                },
                {
                    field: 'Remark',
                    title: '备注'
                }]
        });




    })
    function fnExport() {
        window.open("../AccessRecord/XXExcelImport")
    }
</script>